# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: user.py
# Time: 11:27

from bin.utils.read_util import ReadFileData
from bin.utils.tool_util import BasePage

user_page, user_name = ReadFileData.piece_together_element("login")
logout_page, logout_name = ReadFileData.piece_together_element("logout")


class UserCenterPage(BasePage):
    name = user_name

    def load_android(self):
        self.activity = "com.jumei.login.loginbiz.activities.login.LoginActivity"
        self.my_but = self.get_locator(user_page.get("我的按钮"))
        self.login_registr_but = self.get_locator(user_page.get("登录注册按钮"))
        self.switch_account_but = self.get_locator(user_page.get("切换账号密码登录按钮"))
        self.account_input = self.get_locator(user_page.get("账号输入框"))
        self.pwd_input = self.get_locator(user_page.get("密码输入框"))
        self.agree_agreement_but = self.get_locator(user_page.get("同意用户协议按钮"))
        self.login_but = self.get_locator(user_page.get("登录按钮"))
        self.head_portrait = self.get_locator(user_page.get("头像"))
        self.member_center = self.get_locator(user_page.get("会员中心"))


class LogOutPage(BasePage):
    name = logout_name

    def load_android(self):
        self.my_but = self.get_locator(logout_page.get("我的按钮"))
        self.setting_but = self.get_locator(logout_page.get("设置按钮"))
        self.personal_data_but = self.get_locator(logout_page.get("个人资料按钮"))
        self.as_regards_jumei_but = self.get_locator(logout_page.get("关于聚美按钮"))
        self.logout_but = self.get_locator(logout_page.get("退出账号按钮"))
        self.notarize_but = self.get_locator(logout_page.get("确认按钮"))
        self.cancel_but = self.get_locator(logout_page.get("取消按钮"))
